package com.dzsw.javabase.list;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * ArrayList的构造函数和Add方法 >> https://blog.csdn.net/Int_Xu/article/details/119411074
 */
public class ListSample {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>(10){{
            add("");
            add(null);
        }};
        list.add("a");
        System.out.println(StringUtils.join(list, ","));
        List<String> list1 = new ArrayList<>(List.of("null", ""));
        list1.add("a");
        System.out.println(StringUtils.join(list1, ","));

        String str = "s1||s2||s3||s4||s5||s6||s7||s8||s9";
        String[] ss = str.split("\\|\\|");
        System.out.println(StringUtils.join(ss, ","));
        System.out.println(StringUtils.join(str.split("||"), ","));
    }
}
